import pandas as pd
import numpy as np
a = pd.read_csv('task1_3.csv',encoding='gbk')
a['日期'] = pd.to_datetime(a['日期'])
a = a[a['日期'].dt.day.isin(np.array([15]))]
a = a[(a['省份'] == '湖北') | (a['省份'] == '广东') | (a['省份'] == '上海')].reset_index(drop=True)
b = a[a.省份 == '湖北'].reset_index(drop=True)
c = a[a.省份 == '广东'].reset_index(drop=True)
d = a[a.省份 == '上海'].reset_index(drop=True)
#print(b)
b.to_csv('湖北.csv',encoding='gbk')
c.to_csv('广东.csv',encoding='gbk')
d.to_csv('上海.csv',encoding='gbk')
#a.to_csv('提取.csv',encoding='gbk')
